Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-rule-stream

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-rule-stream

transform stream to cut css into rule-sized chunks

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

css-rule-stream Build Status

transform stream to cut css into rule-sized chunks, which come in the form:

{
  content: "your css"
}

Example:

var rules = require('css-rule-stream'),
    ldjson = require('ldjson-stream');

fs.readFileSync(__dirnam + '/main.css')
  .pipe(rules)
  .pipe(ldjson.serialize())
  .pipe(process.stdout);

main.css

div {
  background: red;
}

.cls {
  color: green;
}

#id {
  font-size: 10px;
}

/* comment */

@media screen and (min-width: 1000px) {
  a {
    text-decoration: underline;
  }
}

a:hover {
  font-weight: bold;  
}

section 


{
  margin: 0;
  /* comment wthin a rule */
  padding: 5px;
}


body > * {
  
}

output

{"content":"div {\n  background: red;\n}"}
{"content":".cls {\n  color: green;\n}"}
{"content":"#id {\n  font-size: 10px;\n}"}
{"content":"@media screen and (min-width: 1000px) {\n  a {\n    text-decoration: underline;\n  }\n}"}
{"content":"a:hover {\n  font-weight: bold;  \n}"}
{"content":"section \n\n\n{\n  margin: 0;\n  /* comment wthin a rule */\n  padding: 5px;\n}"}
{"content":"body > * {\n  \n}"}

Keywords

FAQs

Package last updated on 24 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc